package ff;

import java.util.Arrays;
import java.util.Scanner;

class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		public PairResult(double min,double max){
			this.min=min;
			this.max=max;
		}
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	 }
		static PairResult findMinMax(double[] values){
		    Arrays.sort(values);	
			double x=values[0];
			double y=values[values.length-1];
			PairResult a=new PairResult (x,y);
			return a;
		
	}
	
}
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
     Scanner sc=new Scanner(System.in);
     int n=sc.nextInt();
     double []arr=new double[n];
     for(int i=0;i<n;i++){
    	 double q=sc.nextDouble();
    	 arr[i]=q;
     }
     ArrayUtils s=new ArrayUtils();
     System.out.println(s.findMinMax(arr));
     System.out.println(ArrayUtils.PairResult.class);
	}

}
